﻿namespace winS.Unity.Process
{
    /// <summary>
    /// Provides context for <see cref="IStep"/> execution.
    /// </summary>
    public readonly struct ProcessContext
    {
        /// <summary>
        /// Data passed to process.
        /// </summary>
        public readonly object data;

        /// <summary>
        /// Currently running <see cref="IProcess"/>.
        /// </summary>
        public readonly IProcess process;

        public ProcessContext(IProcess process, object data)
        {
            this.process = process;
            this.data = data;
        }

        public T GetData<T>()
        {
            return (T)data;
        }
    }
}